#define _CRT_SECURE_NO_WARNINGS
#include<iostream>
using namespace std;
//class Stack
//{
//public:
//	Stack(int capacity = 4)
//	{
//		cout << "Stack(int capacity = 4)" << endl;
//
//		_a = new int[capacity];
//		_top = 0;
//		_capacity = capacity;
//	}
//
//	~Stack()
//	{
//		cout << "~Stack()" << endl;
//
//		delete[] _a;
//		_a = nullptr;
//		_top = 0;
//		_capacity = 0;
//	}
//private:
//	int* _a;
//	int  _top;
//	int  _capacity;
//};

class A
{
public:
	A(int a = 0)
		: _a(a)
	{
		cout << "A():" << this << endl;
	}

	~A()
	{
		cout << "~A():" << this << endl;
	}

private:
	int _a;
};

//int main()
//{
//	//Stack s1;
//
//	Stack* p1 = new Stack;
//	delete p1;
//
//	Stack* p2 = (Stack*)operator new(sizeof(Stack));
//	operator delete(p2);
//
//	//printf("%p\n", p1);
//	
//	//Stack* p3 = new Stack[10];
//	////delete[] p3;
//	//delete p3;
//
//	A* p4 = new A[10];
//	//delete p4;
//	//free(p4);
//
int main()
{
	/*int* p1 = new int;
	int* p2 = new int[3]{ 0,1,2 };*/
	//int*p3=(int*)operator new(sizeof(int) * 1000000000000000000);
	A* p1 = (A*)operator new(sizeof(A));
	new(p1)A(1);


	return 0;
	
}